package com.cjm.one.model.goods.entity;

import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;

import java.math.BigDecimal;
import java.time.LocalDateTime;

import com.cjm.one.model.base.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

/**
 * 
 * @TableName goods_sku
 */
@TableName(value ="goods_sku")
@Data
public class GoodsSku extends BaseEntity {
    /**
     * 
     */
//    @TableId(type = IdType.AUTO)
//    private Long id;

    /**
     * 商品编号
     */
    @Schema(description = "商品编号")
    @TableField("sku_code")
    @ExcelProperty("商品编号")
    private String skuCode;

    /**
     * 
     */
    @Schema(description = "sku名称")
    @TableField("sku_name")
    @ExcelProperty("sku名称")
    private String skuName;

    /**
     * 商品id
     */
    @Schema(description = "商品id")
    @TableField("goods_id")
    @ExcelProperty("商品id")
    private Long goodsId;

    /**
     * 缩略图路径
     */
    @Schema(description = "缩略图路径")
    @TableField("thumb_img")
    @ExcelProperty("缩略图路径")
    private String thumbImg;

    /**
     * 售价
     */
    @Schema(description = "售价")
    @TableField("sale_price")
    @ExcelProperty("售价")
    private BigDecimal salePrice;

    /**
     * 市场价格
     */
    @Schema(description = "市场价格")
    @TableField("market_price")
    @ExcelProperty("市场价格")
    private BigDecimal marketPrice;

    /**
     * 成本价格
     */
    @Schema(description = "成本价格")
    @TableField("cost_price")
    @ExcelProperty("成本价格")
    private BigDecimal costPrice;

    /**
     * 库存数
     */
    @Schema(description = "库存数")
    @TableField("stock_num")
    @ExcelProperty("库存数")
    private Integer stockNum;

    /**
     * 销量
     */
    @Schema(description = "销量")
    @TableField("sale_num")
    @ExcelProperty("销量")
    private Integer saleNum;

    /**
     * sku规格信息json
     */
    @Schema(description = "sku规格信息json")
    @TableField("sku_spec")
    @ExcelProperty("sku规格信息json")
    private String skuSpec;

    /**
     * 重量
     */
    @Schema(description = "重量")
    @TableField("weight")
    @ExcelProperty("重量")
    private BigDecimal weight;

    /**
     * 体积
     */
    @Schema(description = "体积")
    @TableField("volume")
    @ExcelProperty("体积")
    private BigDecimal volume;

    /**
     * 线上状态：0-初始值，1-上架，-1-自主下架
     */
    @Schema(description = "线上状态：0-初始值，1-上架，-1-自主下架")
    @TableField("status")
    @ExcelProperty("线上状态：0-初始值，1-上架，-1-自主下架")
    private Integer status;

    @Schema(description = "一级分了id")
    @TableField("category1_id")
    @ExcelProperty("一级分了id")
    private Long category1Id;

    @Schema(description = "二级分类id")
    @TableField("category2_id")
    @ExcelProperty("二级分类id")
    private Long category2Id;


    @Schema(description = "产地")
    @TableField("origin")
    @ExcelProperty("产地")
    private String origin;
    //酒精度
    @Schema(description = "酒精度")
    @TableField("alcohol_content")
    @ExcelProperty("酒精度")
    private BigDecimal alcoholContent;

    //    净含量
    @Schema(description = "净含量")
    @TableField("net_content")
    @ExcelProperty("净含量")
    private Integer netContent;

    @Schema(description = "麦芽度")
    @TableField("malt_degree")
    @ExcelProperty("麦芽度")
    private BigDecimal maltDegree;

    @Schema(description = "预扣库存")
    @TableField("pre_stock")
    @ExcelProperty("预扣库存")
    private Long preStock;

    @Schema(description = "版本号")
    @TableField("version")
    @ExcelProperty("版本号")
    private Long version;


    /**
     * 
     */
//    private Date createTime;
//
//    /**
//     *
//     */
//    private Date updateTime;
//
//    /**
//     * 删除标记（0:不可用 1:可用）
//     */
//    private Integer isDeleted;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        GoodsSku other = (GoodsSku) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getSkuCode() == null ? other.getSkuCode() == null : this.getSkuCode().equals(other.getSkuCode()))
            && (this.getSkuName() == null ? other.getSkuName() == null : this.getSkuName().equals(other.getSkuName()))
            && (this.getGoodsId() == null ? other.getGoodsId() == null : this.getGoodsId().equals(other.getGoodsId()))
            && (this.getThumbImg() == null ? other.getThumbImg() == null : this.getThumbImg().equals(other.getThumbImg()))
            && (this.getSalePrice() == null ? other.getSalePrice() == null : this.getSalePrice().equals(other.getSalePrice()))
            && (this.getMarketPrice() == null ? other.getMarketPrice() == null : this.getMarketPrice().equals(other.getMarketPrice()))
            && (this.getCostPrice() == null ? other.getCostPrice() == null : this.getCostPrice().equals(other.getCostPrice()))
            && (this.getStockNum() == null ? other.getStockNum() == null : this.getStockNum().equals(other.getStockNum()))
            && (this.getSaleNum() == null ? other.getSaleNum() == null : this.getSaleNum().equals(other.getSaleNum()))
            && (this.getSkuSpec() == null ? other.getSkuSpec() == null : this.getSkuSpec().equals(other.getSkuSpec()))
            && (this.getWeight() == null ? other.getWeight() == null : this.getWeight().equals(other.getWeight()))
            && (this.getVolume() == null ? other.getVolume() == null : this.getVolume().equals(other.getVolume()))
            && (this.getStatus() == null ? other.getStatus() == null : this.getStatus().equals(other.getStatus()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getIsDeleted() == null ? other.getIsDeleted() == null : this.getIsDeleted().equals(other.getIsDeleted()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getSkuCode() == null) ? 0 : getSkuCode().hashCode());
        result = prime * result + ((getSkuName() == null) ? 0 : getSkuName().hashCode());
        result = prime * result + ((getGoodsId() == null) ? 0 : getGoodsId().hashCode());
        result = prime * result + ((getThumbImg() == null) ? 0 : getThumbImg().hashCode());
        result = prime * result + ((getSalePrice() == null) ? 0 : getSalePrice().hashCode());
        result = prime * result + ((getMarketPrice() == null) ? 0 : getMarketPrice().hashCode());
        result = prime * result + ((getCostPrice() == null) ? 0 : getCostPrice().hashCode());
        result = prime * result + ((getStockNum() == null) ? 0 : getStockNum().hashCode());
        result = prime * result + ((getSaleNum() == null) ? 0 : getSaleNum().hashCode());
        result = prime * result + ((getSkuSpec() == null) ? 0 : getSkuSpec().hashCode());
        result = prime * result + ((getWeight() == null) ? 0 : getWeight().hashCode());
        result = prime * result + ((getVolume() == null) ? 0 : getVolume().hashCode());
        result = prime * result + ((getStatus() == null) ? 0 : getStatus().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getIsDeleted() == null) ? 0 : getIsDeleted().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(this.getId());
        sb.append(", skuCode=").append(skuCode);
        sb.append(", skuName=").append(skuName);
        sb.append(", goodsId=").append(goodsId);
        sb.append(", thumbImg=").append(thumbImg);
        sb.append(", salePrice=").append(salePrice);
        sb.append(", marketPrice=").append(marketPrice);
        sb.append(", costPrice=").append(costPrice);
        sb.append(", stockNum=").append(stockNum);
        sb.append(", saleNum=").append(saleNum);
        sb.append(", skuSpec=").append(skuSpec);
        sb.append(", weight=").append(weight);
        sb.append(", volume=").append(volume);
        sb.append(", status=").append(status);
        sb.append(", createTime=").append(this.getCreateTime());
        sb.append(", updateTime=").append(this.getUpdateTime());
        sb.append(", isDeleted=").append(this.getIsDeleted());
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}